import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/process/approval_bottom_sheet.dart';
import 'package:enterprise_v6_app/app/components/process/approval_process_widget.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/risk_control/risk_control_approve/risk_control_approve_detail/risk_control_approve_detail_controller.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/risk_control/risk_control_approve/risk_control_approve_detail/risk_control_approve_detailinfo/risk_control_approve_detailinfo_view.dart';

///安全风险辨识管理审签详情
class RiskControlApproveDetailPage extends StatelessWidget {
  RiskControlApproveDetailPage({super.key});

  final controller = Get.put(RiskControlApproveDetailController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        builder: (_) {
          return Scaffold(
            appBar: CustomAppBar(
              titleText: '安全风险辨识管理审签详情',
            ),
            body: Container(
              color: const Color(0xffF5F5F6),
              child: Column(
                children: [
                  Container(
                    height: 54.w,
                    decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(8.r),
                    ),
                    child: TabBar(
                      controller: controller.tabController,
                      tabs: const [
                        Tab(text: '基本信息'),
                        Tab(text: '审批流程'),
                      ],
                      dividerColor: Colors.transparent,
                      labelPadding: EdgeInsets.only(bottom: 20.w),
                      labelStyle: TextStyle(
                        fontSize: 16.sp,
                        fontWeight: FontWeight.w500,
                      ),
                      unselectedLabelStyle: TextStyle(
                        fontSize: 16.sp,
                        fontWeight: FontWeight.w500,
                      ),
                      labelColor: Colors.black,
                      unselectedLabelColor: const Color(0xffA0A7B5),
                      indicatorPadding: EdgeInsets.only(top: 35.w, bottom: 10.w),
                      indicator: const BoxDecoration(
                        image: DecorationImage(
                          image: AssetImage(
                            'assets/images/icon_select_arc.png',
                          ),
                        ),
                      ),
                    ),
                  ),
                  Expanded(
                    child: Container(
                      padding: EdgeInsets.only(top: 14.w),
                      color: const Color(0xffF5F5F6),
                      child: TabBarView(
                        controller: controller.tabController,
                        children: [
                          RiskControlApproveDetailInfoPage(),
                          ApprovalProcessWidget(nodeList: controller.processList),
                        ],
                      ),
                    ),
                  ),
                  SizedBox(height: 210.w),
                ],
              ),
            ),
            bottomSheet: ApprovalBottomSheet(
                onOpinion: controller.onOpinion,
                onSign: controller.onSign,
                onOperation: controller.onOperation),
          );
        });
  }
}
